Skip to content

feat: preserve attribution source in fastgpt_sem#7304

Open
c121914yu wants to merge 1 commit into
labring:mainfrom
c121914yu:codex/fastgpt-sem-source
Open

feat: preserve attribution source in fastgpt_sem#7304
c121914yu wants to merge 1 commit into
labring:mainfrom
c121914yu:codex/fastgpt-sem-source

Conversation

@c121914yu

Copy link
Copy Markdown
Collaborator

Accept and parse the CRM-compatible source object, persist it in fastgpt_sem.source, preserve legacy string sources and CTA fastgpt_source values, and reuse UTM values from the source object. Targeted marketing tests 4 passed and global tests 1670 passed. Full app typecheck is blocked by the upstream missing src/assets/skill/runtimeUpgradeModalBg.jpg file.

Copilot AI review requested due to automatic review settings July 14, 2026 12:58
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 18.43% 1632 / 8855
🔵 Statements 18.41% 1713 / 9300
🔵 Functions 16.21% 342 / 2109
🔵 Branches 15.1% 759 / 5024
File CoverageNo changed files found.
Generated in workflow #1405 for commit ed4b059 by the Vitest Coverage Report Action

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends FastGPT’s marketing attribution tracking to accept a CRM-compatible source object (in addition to the legacy string fastgpt_source), persist it into fastgpt_sem.source, and reuse UTM fields from that object when explicit UTM query params are absent.

Changes:

  • Added a FastGPTSourceSchema and widened fastgpt_sem.source to string | object for backward compatibility.
  • Implemented parseFastGPTSource to safely parse/validate the source query param as a structured attribution object.
  • Updated app initialization to merge source + legacy fastgpt_source and to fall back to source-provided UTM values.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
projects/app/test/web/support/marketing/utils.test.ts Adds unit tests for parsing valid/invalid source attribution payloads.
projects/app/src/web/support/marketing/utils.ts Introduces parseFastGPTSource using Zod validation to safely parse the source param.
projects/app/src/web/context/useInitApp.ts Reads source from the URL, reuses UTM values from it, and persists fastgpt_sem.source as object-or-string.
packages/global/support/marketing/type.ts Adds FastGPTSourceSchema and updates FastGPT_SEM_Schema.source to accept either legacy strings or the new attribution object.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_ed4b05906223a59ffbc0be54b0da29ffed580ae1

🕒 Time: 2026-07-14 21:08:03 (UTC+8)

@github-actions

Copy link
Copy Markdown

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_ed4b05906223a59ffbc0be54b0da29ffed580ae1

🕒 Time: 2026-07-14 21:10:06 (UTC+8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants